//
//  HistoryReportView.m
//  SmartWatch
//
//  Created by zwj on 2022/11/26.
//

#import "HistoryReportView.h"

@implementation HistoryReportView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = BACKGROUNDCOLOR;
        self.layer.cornerRadius = 10;
        
        MyLinearLayout *root = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert];
        root.myHorzMargin = 0;
        root.padding = UIEdgeInsetsMake(10, 10, 10, 10);
        root.myHeight = frame.size.height;
        root.subviewVSpace = 10;
        root.gravity = MyGravity_Horz_Center;
        [self addSubview:root];
        
        UILabel *name = [UILabel createLabelText:@"查看7日内报告" font:UIFontMake(15) textColor:COLOR1515];
        name.mySize = kAutoSize;
        [root addSubview:name];
        
        UIScrollView *scrollView = [[UIScrollView alloc]init];
        scrollView.showsVerticalScrollIndicator = NO;
        scrollView.myHorzMargin = 0;
        scrollView.weight = 1;
        [root addSubview:scrollView];
        
        MyLinearLayout *content = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert];
        content.myHorzMargin = 0;
        content.myHeight = kAutoHeight;
        content.subviewVSpace = 10;
        [scrollView addSubview:content];
        
        NSArray *array = @[@"",@"",@"",@"",@""];
        for (int i = 0; i < array.count; i++) {
            MyLinearLayout *hort = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Horz];
            hort.myHorzMargin = 0;
            hort.gravity = MyGravity_Vert_Center | MyGravity_Horz_Between;
            hort.myHeight = 44;
            hort.backgroundColor = COLOR_4;
            hort.padding = UIEdgeInsetsMake(0, 15, 0, 15);
            ViewCorner(hort, 10);
            [content addSubview:hort];
            
            UILabel *time = [UILabel createLabelText:@"2022-11-12" font:UIFontMake(15) textColor:COLOR1515];
            time.mySize = kAutoSize;
            [hort addSubview:time];
            
            UIImageView *right = [[UIImageView alloc]initWithImage:UIImageMake(@"icon_arrow_right")];
            right.mySize = CGSizeMake(16, 16);
            [hort addSubview:right];
            
        }
        
    }
    return self;
}

@end
